﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrgTree.aspx.cs" Inherits="Honestysoft.Baseframework.WebUI.SystemManage.Permission.OrgTree" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="../../Scripts/jquery-1.6.min.js"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <link href="../../Styles/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/icon.css" rel="stylesheet" type="text/css" />   
    <link href="../../Styles/control.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" >
        $(function () {
            var isFirst = true;
            $('#treeOrg').tree({
                checkbox: false,
                dnd: false,
                url: '<%=Page.ResolveClientUrl("~/") %>Apply/OuInfo.ashx?Module=4&randID=' + escape(new Date()),
                method: "POST",
                onClick: function (node) {
                    if (node.attributes["OuType"] == '<%=((int)Honestysoft.Baseframework.Model.EnumItem.OuType.Employee).ToString() %>') {
                        var uri = '<%=Honestysoft.Baseframework.WebUI.Globals.Home %>' + 'SystemManage/Permission/UserRoleList.aspx?FunctionID=<%=Request["FunctionID"]+"" %>&ID=' + node.id + "&EmpName=" + escape(node.text);
                        window.parent.frames["ifrmInfo"].location.href = uri;
                    }
                    else {
                        window.parent.frames["ifrmInfo"].location.href = '<%=Honestysoft.Baseframework.WebUI.Globals.Home %>UIFramework/blank.aspx';
                    }
                    $('#treeOrg').tree('expand', node.target);
                },
                onLoadSuccess: function (node, data) {
                    if (data != "") {
                        var rootNode = $('#treeOrg').tree('getRoot');
                        $('#treeOrg').tree('expand', rootNode.target);
                        if (isFirst) {
                            $('#treeOrg').tree('select', rootNode.target);
                            isFirst = false;
                        }
                    }
                }
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ul id="treeOrg"></ul>
    </form>
</body>
</html>
